﻿@using SCMS.Resource
@model SCMS.UI.Models.pVoucher
@{AjaxOptions ajaxOpts = new AjaxOptions
  {
      UpdateTargetId = "pvDiv",
      LoadingElementId = "loading",
      HttpMethod = "Post",
      Url = Url.Action("EditPVDetails"),
      OnSuccess = "CloseDialog();usermsg('" + Resources.GoodsReceivedNote_LoadGRN_SuccessMsg + "'); if (document.getElementById('table') != null) {initSorter();sorter.size(20);}",
      OnFailure = "javascript:errormsg()"
  };}
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
@using (Ajax.BeginForm(null, null, ajaxOpts, new { @class = "form", @id = "frmPV" }))
{
    @Html.ValidationSummary(true)
    <br />
    <input type="hidden" id="actionStatus" value="@ViewBag.Response" />
    <input type="hidden" id="statusMsg" value="@ViewBag.msg" />
    
    @Html.HiddenFor(x => x.EntityPV.Id)
    @Html.HiddenFor(x => x.EntityPV.CountryProgrammeId)
    @Html.HiddenFor(x => x.EntityPV.PreparedBy)
    @Html.HiddenFor(x => x.EntityPV.PreparedOn)
    @Html.HiddenFor(x => x.EntityPV.IsSubmitted)
    @Html.HiddenFor(x => x.EntityPV.TotalAmount)
    <table width="98%" align="center" cellpadding="0">
        <tr>
            <th align="center" width="33.3%">
                @Resources_morgan.Global_String_VoucherNumber
            </th>
            <th align="center" width="33.3%">
                @Resources_morgan.Global_String_RequestforPaymentNumber
            </th>
            <th align="center" width="33.3%">
                @Resources.Budget_CreateProject_ProjectName
            </th>
        </tr>
        <tr>
            <td align="center">
                @Html.TextBoxFor(m => m.EntityPV.RefNumber, new { @readonly = "readonly", id = "refNo" })
            </td>
            <td align="center">
                @Html.DropDownListFor(x => x.EntityPV.PaymentRequestId, Model.RFPList, Resources.Global_String_PleaseSelect, new { @disabled = true })
                @Html.ValidationMessageFor(x => x.EntityPV.PaymentRequestId, Resources.Global_String_Required)
            </td>
            <td align="left">
                @Html.DisplayFor(x => x.RFPEntity.PurchaseOrder.ProjectDonor.Project.Name)
            </td>
        </tr>
        <tr>
            <th align="center">
                @Resources.Budget_CreateProject_ProjectNumber
            </th>
            <th align="center">
                @Resources.Global_String_PONo
            </th>
            <th align="center">
                @Resources_morgan.Global_String_ModeofPayment
            </th>
        </tr>
        <tr>
            <td align="center">
                @Html.DisplayFor(x => x.RFPEntity.PurchaseOrder.ProjectDonor.ProjectNumber)
            </td>
            <td align="center">
                &nbsp;
                @Html.DisplayFor(x => x.RFPEntity.PurchaseOrder.RefNumber)
            </td>
            <td align="center">
                @Html.DisplayFor(x => x.RFPEntity.PaymentType.Description)
            </td>
        </tr>
        <tr>
            <th align="center">
                @Resources_morgan.PaymentVoucherLoadPV_ProjectBankAccount
            </th>
            <th align="center">
            </th>
            <th align="center">
            </th>
        </tr>
        <tr>
            <td align="center">
                @Html.TextBoxFor(x => x.EntityPV.ProjectBankAccount)
                @Html.ValidationMessageFor(x => x.EntityPV.ProjectBankAccount, Resources.Global_String_Required)
            </td>
            <td align="center">
            </td>
            <td align="center">
            </td>
        </tr>
    </table>
           if (Model.RFPBLz.Count > 0)
           {
    <h4 style="text-align: center;">
        @Resources_morgan.Global_String_Particulars</h4>
    <table width="98%" align="center" cellspacing="0" cellpadding="0" border="1" class="cardTable">
        <tr class="grideven">
            <th>
                @Resources.Report_ORDetails_BLine
            </th>
            <th>
                @Resources.Global_String_PaymentDetails
            </th>
            <th>
                @Resources.ExpenseClaim_ViewExpsClaimsDetails_AccountCode
            </th>
            <th>
                @Resources.Global_String_Amount
            </th>
        </tr>
        @for (int i = 0; i < Model.RFPBLz.Count; i++)
        {
            <tr class="gridodd">
                <td style="width: 15%;" title="@Model.RFPBLz[i].LineDescription" >
                    @Model.RFPBLz[i].BLine
                    @Html.HiddenFor(x => x.RFPBLz[i].RFPItemId)
                    @Html.HiddenFor(x => x.RFPBLz[i].Id)
                </td>
                <td style="width: 50%;">
                    @Html.TextBoxFor(m => m.RFPBLz[i].Description)
                    @Html.ValidationMessageFor(m => m.RFPBLz[i].Description, Resources.Global_String_Required)
                </td>
                <td style="width: 17%;">
                    @Html.DropDownListFor(x => x.RFPBLz[i].GLId, new SelectList(Model.RFPBLz[i].glCodes, "Id", "Code", Model.RFPBLz[i].GLId), Resources.Global_String_PleaseSelect)
                    @Html.ValidationMessageFor(x => x.RFPBLz[i].GLId, Resources.Global_String_Required)
                </td>
                <td style="width: 17%;" align="right">
                    @Model.RFPBLz[i].amunt.ToString("#,##.00")
                    @Html.HiddenFor(x => x.RFPBLz[i].amunt)
                </td>
            </tr>
        }
    </table>
    <hr />
    <table width="98%" align="center" cellpadding="0">
        <tr>
            <td>
                <input type="submit" class="btn green" value="  @Resources_morgan.PaymentVoucher_ViewPVDetails_EditPV  " />
            </td>
        </tr>
    </table>        
           }
}
